from flask import Flask
from config import DevConfig,PorConfig
from os import environ

def creat_flask():
    app = Flask(__name__)
    # 判断环境
    if environ.get('my_env') == 'dev':
        my_config = DevConfig
    else:
        my_config = PorConfig
        # 加载配置文件
    app.config.from_object(my_config)
    return app